# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json
imports:
  commons: ./commons.yml
  pagination: ./utils/pagination.yml
service:
  auth: true
  base-path: /api/public
  endpoints:
    get:
      docs: Get a observation
      method: GET
      path: /observations/{observationId}
      path-parameters:
        observationId:
          type: string
          docs: The unique langfuse identifier of an observation, can be an event, span or generation
      response: commons.ObservationsView
    getMany:
      docs: Get a list of observations
      method: GET
      path: /observations
      request:
        name: GetObservationsRequest
        query-parameters:
          page: optional<integer>
          limit: optional<integer>
          name: optional<string>
          userId: optional<string>
          type: optional<string>
          traceId: optional<string>
          parentObservationId: optional<string>
      response: ObservationsViews

types:
  Observations:
    properties:
      data: list<commons.Observation>
      meta: pagination.MetaResponse

  ObservationsViews:
    properties:
      data: list<commons.ObservationsView>
      meta: pagination.MetaResponse
